//
//  LKMyShopHeaderIntroView.m
//  Mideleague_Agent
//
//  Created by Zhiwang on 2020/5/26.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKMyShopHeaderIntroView.h"
#import "LKDefineFile.h"
#import "NSString+Regex.h"
@interface LKMyShopHeaderIntroView()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *accountLabel;
@property (weak, nonatomic) IBOutlet UILabel *openDateLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;



@end


@implementation LKMyShopHeaderIntroView


-(void)setDetailModel:(LKMyShopListDetailModel *)detailModel{
    _detailModel = detailModel;
    self.nameLabel.text = _detailModel.mch_info.merchant_name;
    self.accountLabel.text = [NSString stringWithFormat:@"商户账号:%@",_detailModel.mch_info.merchant_phone];
    self.openDateLabel.text = [NSString stringWithFormat:@"开户时间:%@",[NSString timestampSwitchTime:[_detailModel.mch_info.add_time integerValue] andFormatter:@"YYYY-MM-dd"]];
//    if ([self.detailModel.mch_info.agency_business containsString:@"3"]) {
//        self.rightBtn setTitle:@"优惠券" forState:uicont
//    }else{
//
//    }
    if (self.detailModel.mch_info.agency_business.length == 0) {
        self.leftBtn.hidden = YES;
        self.rightBtn.hidden = YES;
    }else if([self.detailModel.mch_info.agency_business containsString:@"3"]){
        self.leftBtn.hidden = NO;
        self.rightBtn.hidden = NO;
    }else if ([self.detailModel.mch_info.agency_business containsString:@"1"] && ![self.detailModel.mch_info.agency_business containsString:@"3"]){
        self.leftBtn.hidden = NO;
        self.rightBtn.hidden = YES;
    }
}

-(void)awakeFromNib{
    [super awakeFromNib];
    self.leftBtn.layer.cornerRadius = 12;
    self.leftBtn.layer.borderWidth = 1;
    self.leftBtn.layer.borderColor = yellowDefaultColor.CGColor;
    self.leftBtn.layer.masksToBounds = YES;
    self.rightBtn.layer.cornerRadius = 12;
    self.rightBtn.layer.masksToBounds = YES;
    self.rightBtn.layer.borderWidth = 1;
    self.rightBtn.layer.borderColor = yellowDefaultColor.CGColor;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
